package com.itheima.dao;

import com.itheima.domian.Role;
import com.itheima.domian.UserLogin;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @author althle
 * @create 08-24-14:44
 * @功能
 * @注释
 */
public interface UserLoginDao {


    @Select("select * from t_user")
    public List<UserLogin> findAll();

    @Select("select * from t_user where username = #{username} and password = #{password} ")
    public UserLogin LoginIn(@Param("username") String username, @Param("password") String password);

    @Select("SELECT * FROM t_user_role tu,t_role tr WHERE tu.role_id = tr.id AND tu.user_id =#{id}")
    public List<Role> findRoleList(@Param("id") Integer id);

    @Select("select * from t_user where username = #{username}")
    public UserLogin findByName(@Param("username") String username);

}
